<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>xxpay 多模块语言切换测试</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            overflow: hidden;
        }

        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 40px;
            text-align: center;
        }

        .header h1 {
            font-size: 32px;
            margin-bottom: 10px;
            font-weight: 600;
        }

        .header p {
            font-size: 16px;
            opacity: 0.9;
        }

        .modules-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
            gap: 30px;
            padding: 40px;
        }

        .module-card {
            background: #f8f9fa;
            border-radius: 12px;
            padding: 30px;
            border: 2px solid #e9ecef;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .module-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
            border-color: #667eea;
        }

        .module-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #667eea, #764ba2);
        }

        .module-header {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
        }

        .module-icon {
            width: 50px;
            height: 50px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            color: white;
        }

        .manage-icon {
            background: linear-gradient(135deg, #ff6b6b, #ee5a24);
        }

        .agent-icon {
            background: linear-gradient(135deg, #4ecdc4, #44a08d);
        }

        .merchant-icon {
            background: linear-gradient(135deg, #45b7d1, #96c93d);
        }

        .module-info h3 {
            font-size: 20px;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .module-info p {
            color: #7f8c8d;
            font-size: 14px;
        }

        .port-badge {
            background: #667eea;
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
        }

        .test-buttons {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-top: 20px;
        }

        .test-btn {
            padding: 12px 20px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.3s ease;
            text-decoration: none;
            text-align: center;
            display: block;
        }

        .login-btn {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
        }

        .login-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
        }

        .test-btn-secondary {
            background: #f8f9fa;
            color: #495057;
            border: 2px solid #e9ecef;
        }

        .test-btn-secondary:hover {
            background: #e9ecef;
            border-color: #dee2e6;
        }

        .status-indicator {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 15px;
            padding: 10px;
            background: #e8f5e8;
            border-radius: 6px;
            font-size: 13px;
        }

        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #28a745;
        }

        .features-list {
            margin-top: 20px;
        }

        .features-list h4 {
            font-size: 14px;
            color: #495057;
            margin-bottom: 10px;
        }

        .features-list ul {
            list-style: none;
            padding: 0;
        }

        .features-list li {
            padding: 5px 0;
            font-size: 13px;
            color: #6c757d;
            position: relative;
            padding-left: 20px;
        }

        .features-list li::before {
            content: '✓';
            position: absolute;
            left: 0;
            color: #28a745;
            font-weight: bold;
        }

        .footer {
            background: #f8f9fa;
            padding: 30px;
            text-align: center;
            border-top: 1px solid #e9ecef;
        }

        .footer h3 {
            color: #495057;
            margin-bottom: 15px;
        }

        .footer p {
            color: #6c757d;
            font-size: 14px;
            line-height: 1.6;
        }

        .api-endpoints {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            margin-top: 15px;
        }

        .api-endpoints h5 {
            font-size: 13px;
            color: #495057;
            margin-bottom: 8px;
        }

        .api-endpoint {
            font-family: 'Courier New', monospace;
            font-size: 11px;
            color: #6c757d;
            background: white;
            padding: 4px 8px;
            border-radius: 4px;
            margin: 2px 0;
            display: block;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>xxpay 多模块语言切换测试</h1>
            <p>测试运营平台、代理商系统、商户系统的中英文切换功能</p>
        </div>

        <div class="modules-grid">
            <!-- 运营平台模块 -->
            <div class="module-card">
                <div class="module-header">
                    <div class="module-icon manage-icon">🏢</div>
                    <div class="module-info">
                        <h3>运营平台 (Management)</h3>
                        <p>Operations Platform Interface</p>
                    </div>
                    <div class="port-badge">56701</div>
                </div>
                
                <div class="status-indicator">
                    <div class="status-dot"></div>
                    <span>语言切换功能已完成</span>
                </div>

                <div class="test-buttons">
                    <a href="http://localhost:56701/src/views/user/login.html" class="test-btn login-btn" target="_blank">
                        测试登录页面语言切换
                    </a>
                    <a href="http://localhost:56701/test_i18n.html" class="test-btn test-btn-secondary" target="_blank">
                        测试国际化功能
                    </a>
                </div>

                <div class="features-list">
                    <h4>已实现功能:</h4>
                    <ul>
                        <li>登录页面中英文切换</li>
                        <li>完整的国际化配置</li>
                        <li>语言偏好本地存储</li>
                        <li>API接口支持</li>
                        <li>动态页面文本更新</li>
                    </ul>
                </div>

                <div class="api-endpoints">
                    <h5>API接口:</h5>
                    <code class="api-endpoint">POST /api/i18n/switch</code>
                    <code class="api-endpoint">GET /api/i18n/current</code>
                    <code class="api-endpoint">GET /api/i18n/languages</code>
                </div>
            </div>

            <!-- 代理商系统模块 -->
            <div class="module-card">
                <div class="module-header">
                    <div class="module-icon agent-icon">👥</div>
                    <div class="module-info">
                        <h3>代理商系统 (Agent)</h3>
                        <p>Agent System Interface</p>
                    </div>
                    <div class="port-badge">56702</div>
                </div>
                
                <div class="status-indicator">
                    <div class="status-dot"></div>
                    <span>语言切换功能已完成</span>
                </div>

                <div class="test-buttons">
                    <a href="http://localhost:56702/x_agent/src/views/user/login.html" class="test-btn login-btn" target="_blank">
                        测试登录页面语言切换
                    </a>
                    <a href="http://localhost:56702/test_i18n.html" class="test-btn test-btn-secondary" target="_blank">
                        测试国际化功能
                    </a>
                </div>

                <div class="features-list">
                    <h4>已实现功能:</h4>
                    <ul>
                        <li>登录页面中英文切换</li>
                        <li>新创建完整国际化配置</li>
                        <li>代理商专用语言包</li>
                        <li>佣金管理相关翻译</li>
                        <li>下级商户管理翻译</li>
                    </ul>
                </div>

                <div class="api-endpoints">
                    <h5>API接口:</h5>
                    <code class="api-endpoint">POST /api/i18n/switch</code>
                    <code class="api-endpoint">GET /api/i18n/current</code>
                    <code class="api-endpoint">GET /api/i18n/languages</code>
                </div>
            </div>

            <!-- 商户系统模块 -->
            <div class="module-card">
                <div class="module-header">
                    <div class="module-icon merchant-icon">🏪</div>
                    <div class="module-info">
                        <h3>商户系统 (Merchant)</h3>
                        <p>Merchant System Interface</p>
                    </div>
                    <div class="port-badge">56703</div>
                </div>
                
                <div class="status-indicator">
                    <div class="status-dot"></div>
                    <span>语言切换功能已完成</span>
                </div>

                <div class="test-buttons">
                    <a href="http://localhost:56703/src/views/user/login.html" class="test-btn login-btn" target="_blank">
                        测试登录页面语言切换
                    </a>
                    <a href="http://localhost:56703/test_i18n.html" class="test-btn test-btn-secondary" target="_blank">
                        测试国际化功能
                    </a>
                </div>

                <div class="features-list">
                    <h4>已实现功能:</h4>
                    <ul>
                        <li>登录页面中英文切换</li>
                        <li>完整的国际化配置</li>
                        <li>商户专用语言包</li>
                        <li>支付相关翻译</li>
                        <li>注册链接翻译</li>
                    </ul>
                </div>

                <div class="api-endpoints">
                    <h5>API接口:</h5>
                    <code class="api-endpoint">POST /api/i18n/switch</code>
                    <code class="api-endpoint">GET /api/i18n/current</code>
                    <code class="api-endpoint">GET /api/i18n/languages</code>
                </div>
            </div>
        </div>

        <div class="footer">
            <h3>🎉 语言切换功能完成总结</h3>
            <p>
                所有三个模块的登录页面都已成功添加中英文切换按钮。<br>
                每个模块都有独立的语言偏好存储，支持动态切换，并提供完整的国际化API接口。<br>
                用户可以在登录页面右上角找到语言切换按钮，点击即可在中文和英文之间切换。
            </p>
        </div>
    </div>

    <script>
        // 检查服务状态
        function checkServiceStatus() {
            const ports = [56701, 56702, 56703];
            const modules = ['manage', 'agent', 'merchant'];
            
            ports.forEach((port, index) => {
                fetch(`http://localhost:${port}/api/i18n/current`)
                    .then(response => response.json())
                    .then(data => {
                        console.log(`${modules[index]} service (${port}): OK`);
                    })
                    .catch(error => {
                        console.log(`${modules[index]} service (${port}): Not available`);
                    });
            });
        }

        // 页面加载时检查服务状态
        document.addEventListener('DOMContentLoaded', function() {
            checkServiceStatus();
        });
    </script>
</body>
</html>
